<%--
  Created by IntelliJ IDEA.
  User: 何祥
  Date: 2022/4/19
  Time: 23:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>

<head>
    <title style="color: red">用户信息界面【注意:何祥是大帅比！】</title>
    <meta charset="UTF-8" http-equiv="Content-Type" content="text/html">
    <script src="/js/jquery-1.7.2.min.js"></script>
</head>

<body>

    <div align="center">用户管理系统</div><br>

    <div style="margin-left: 63%">
        <button id="in" onclick="into()">办理入职</button>
    </div><br>

    <table border="1" align="center">
        <thead align="center">
            <td>姓名</td>
            <td>工号</td>
            <td>职位</td>
            <td>状态</td>
            <td>描述</td>
            <td>操作</td>
        </thead>
    <c:forEach items="${users}" var="user">
        <tr align="center">
            <td width="50">${user.name}</td>
            <td width="50">${user.no}</td>
            <td width="150">${user.position}</td>
            <td width="100">${user.status}</td>
            <td width="150">${user.reason}</td>
            <td width="200">
                <button id="out" onclick="out(${user.id})">办理离职</button>
                <button id="update" onclick="info(${user.id})">信息更新</button>
            </td>
        </tr>
    </c:forEach>
    </table>

</body>

<script>

        /*办理入职*/
        function into(){
            var url = "http://qxtice.natappfree.cc/xm/user/in";
            window.open(url,'_self');
        }

        /*办理离职*/
        function out(id){
            var userId = id;
            var url = "http://qxtice.natappfree.cc/xm/user/out?id="+userId;
            window.open(url,'_self');
        }

        /*信息更新*/
        function info(id){
            var userId = id;
            var url = "http://qxtice.natappfree.cc/xm/user/updateUserInfo?id="+userId;
            window.open(url,'_self');
        }
</script>
</html>
